<?php

namespace app\v1\model;

use think\Model;
use think\model\concern\SoftDelete;

class CountryIntro extends Model
{
    use SoftDelete;
    protected $deleteTime = 'delete_time';

    /**
     * @param int $id
     * @return array|\PDOStatement|string|\think\Collection|Model|null
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function getCountryIntro(int $id = 0)
    {
        $model = $this->field('id,name,content');
        if (empty($id)) {
            return $model->select();
        } else {
            return $model->find($id);
        }
    }
}
